package edu.cebanc.spring.biblioteca.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import edu.cebanc.spring.biblioteca.services.BookCopiesService;

@Controller
@RequestMapping(value="/bookCopies")
public class BookCopyController {

	@Autowired
	BookCopiesService bookCopiesService;
	
	@RequestMapping(method=RequestMethod.GET)
	public String getMainView(Model model) {
		model.addAttribute("bookCopy", bookCopiesService.listBookCopies());
		
		return "bookCopiesMain";
	}
}
